/**
 *  Copyright 2009-2015 by WWW.KNET.CN  All rights reserved.
 */
package cn.knet.sp.ncrm.modules.call.record.entity;

import java.util.Date;

import cn.knet.sp.ncrm.common.persistence.DataEntity;
import cn.knet.sp.ncrm.common.utils.TimeUtils;

/**
 * TODO(这里用一句话描述这个类的作用)
 * 
 * @author Gehaiyang
 * @date 2015年6月29日 下午3:40:46
 * 
 */
public class RecordInfo extends DataEntity<RecordInfo> {

	private static final long serialVersionUID = 8061296267942426501L;

	private String callID;
	private String callerNO;
	private String calleeNO;
	private Integer agentID;
	private String agentName;
	private int callCenterID;
	private int virtualCallCenterID;
	private Date beginTime;
	private Date endTime;
	private String fileName;
	private int callType;
	private int serviceNO;
	private Date visitTime;
	private int visitFlag;
	private int mediaType;
	private int modNO;
	private int trkNO;
	private int serviceID;
	private String serviceInfo;
	private String callInfo;
	private int stopReason;
	private Date modifyDate;
	private String finalFileName;
	private String realFileName;
	private String success;
	private int score;
	private String odcqID;
	private int longTime;
	private int direction;
	private String callTypeText;
	private String dialingNO;//主叫号码
	private String calledNO;//被叫号码
	
	public String getCallID() {
		return callID;
	}
	public void setCallID(String callID) {
		this.callID = callID;
	}
	/**
	 * 被叫
	 */
	public String getCallerNO() {
		return callerNO;
	}
	public void setCallerNO(String callerNO) {
		this.callerNO = callerNO;
	}
	public String getCalleeNO() {
		return calleeNO;
	}
	public void setCalleeNO(String calleeNO) {
		this.calleeNO = calleeNO;
	}
	public Integer getAgentID() {
		return agentID;
	}
	public void setAgentID(Integer agentID) {
		this.agentID = agentID;
	}
	
	public String getAgentName() {
		return agentName;
	}
	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}
	public int getCallCenterID() {
		return callCenterID;
	}
	public void setCallCenterID(int callCenterID) {
		this.callCenterID = callCenterID;
	}
	public int getVirtualCallCenterID() {
		return virtualCallCenterID;
	}
	public void setVirtualCallCenterID(int virtualCallCenterID) {
		this.virtualCallCenterID = virtualCallCenterID;
	}
	public Date getBeginTime() {
		return beginTime;
	}
	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public int getCallType() {
		return callType;
	}
	public void setCallType(int callType) {
		this.callType = callType;
	}
	public int getServiceNO() {
		return serviceNO;
	}
	public void setServiceNO(int serviceNO) {
		this.serviceNO = serviceNO;
	}
	public Date getVisitTime() {
		return visitTime;
	}
	public void setVisitTime(Date visitTime) {
		this.visitTime = visitTime;
	}
	public int getVisitFlag() {
		return visitFlag;
	}
	public void setVisitFlag(int visitFlag) {
		this.visitFlag = visitFlag;
	}
	public int getMediaType() {
		return mediaType;
	}
	public void setMediaType(int mediaType) {
		this.mediaType = mediaType;
	}
	public int getModNO() {
		return modNO;
	}
	public void setModNO(int modNO) {
		this.modNO = modNO;
	}
	public int getTrkNO() {
		return trkNO;
	}
	public void setTrkNO(int trkNO) {
		this.trkNO = trkNO;
	}
	public int getServiceID() {
		return serviceID;
	}
	public void setServiceID(int serviceID) {
		this.serviceID = serviceID;
	}
	public String getServiceInfo() {
		return serviceInfo;
	}
	public void setServiceInfo(String serviceInfo) {
		this.serviceInfo = serviceInfo;
	}
	public String getCallInfo() {
		return callInfo;
	}
	public void setCallInfo(String callInfo) {
		this.callInfo = callInfo;
	}
	public int getStopReason() {
		return stopReason;
	}
	public void setStopReason(int stopReason) {
		this.stopReason = stopReason;
	}
	public Date getModifyDate() {
		return modifyDate;
	}
	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}
	public String getFinalFileName() {
		return finalFileName;
	}
	public void setFinalFileName(String finalFileName) {
		this.finalFileName = finalFileName;
	}
	public String getRealFileName() {
		return realFileName;
	}
	public void setRealFileName(String realFileName) {
		this.realFileName = realFileName;
	}
	public String getSuccess() {
		return success;
	}
	public void setSuccess(String success) {
		this.success = success;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public String getOdcqID() {
		return odcqID;
	}
	public void setOdcqID(String odcqID) {
		this.odcqID = odcqID;
	}
	public int getLongTime() {
		return longTime;
	}
	public void setLongTime(int longTime) {
		this.longTime = longTime;
	}
	public int getDirection() {
		return direction;
	}
	public void setDirection(int direction) {
		this.direction = direction;
	}
	public String getCallTypeText() {
		if(direction == 2 || direction == 4) {
			callTypeText = "呼出";
		} else {
			callTypeText = "呼入";
		}
		return callTypeText;
	}
	public void setCallTypeText(String callTypeText) {
		this.callTypeText = callTypeText;
	}
	/**
	 * 主叫号码
	 */
	public String getDialingNO() {
		if(direction == 2 || direction == 4) {
			dialingNO = callerNO;
		} else {
			dialingNO = calleeNO;
		}
		return dialingNO;
	}
	public void setDialingNO(String dialingNO) {
		this.dialingNO = dialingNO;
	}
	/**
	 * 被叫号码
	 */
	public String getCalledNO() {
		if(direction == 2 || direction == 4) {
			calledNO = calleeNO;
		} else {
			calledNO = callerNO;
		}
		return calledNO;
	}
	public void setCalledNO(String calledNO) {
		this.calledNO = calledNO;
	}
	/**
	 * 通话时长
	 */
	public String getCallTime(){
		return TimeUtils.toAllTimeString(getTrkNO());
	}
	/**
	 * 振铃时长
	 */
	public String getRingTime(){
		long beginTime = getBeginTime().getTime();
		long endTime = getEndTime().getTime();
		return TimeUtils.toAllTimeString((endTime - beginTime)/1000 - getTrkNO());
	}
	/**
	 * 总时长
	 */
	public String getTotalTime(){
		long beginTime = getBeginTime().getTime();
		long endTime = getEndTime().getTime();
		return TimeUtils.toAllTimeString((endTime - beginTime)/1000);
	}
}
